/*
 * Copyright (c) 2018. QDU 2015 Java1 Team CompilationError
 */

package team.mai.antexpress.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import team.mai.antexpress.entities.UserEntity;
import team.mai.antexpress.services.UserService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"applicationContext.xml"})
public class InsertUserTest {
	@Autowired
	UserService userService;

	@Test
	public void testInsertUser() {
		UserEntity operator = new UserEntity();
		operator.setPermissionGroupId(1);
		UserEntity toInsert = new UserEntity("inku", "1234",
				"M", 1, 1, 1,
				"13564646464", "inkuxuan@mai.team", 6666);
		int result = userService.insertUser("inku", toInsert);
		Assert.assertEquals(UserService.INTERNAL_ERROR, result);
	}
}
